const link = require('./link')
const conn = link.conn

function add_data(userData) {

	var addSql = 'INSERT INTO userdata(union_id,name,avatar) VALUES(?,?,?)';
	var addSqlParams = [userData.union_id, userData.name, userData.avatar];
	conn.query(addSql, addSqlParams, (err, res) => {
		if (err) {
			console.log(err.message);
			return;
		}
		console.log('INSERT OK!' + res);
	})

}

module.exports = {
	add_data
}
 